import java.util.ArrayList;
import java.util.List;

public class Leet839 {

	public static void main(String[] args) {
		System.out.println(numSimilarGroups(new String[]{"omv","ovm"}));
	}
	static public int numSimilarGroups(String[] strs) {
		List<List<String>> list = new ArrayList<>();
		
		for(String s :strs) {
			if(list.size()==0) {
				list.add(new ArrayList<>());
				list.get(0).add(s);
				break;
			}
			bre:
			for(List<String> l :list) {
				for(String str :l) {
					if(check(s,str)) {
						l.add(s);
						break bre;
					}
				}
				list.add(new ArrayList<>());
				list.get(list.size()-1).add(s);
			}
		}
		return list.size();
    }
	static boolean check(String s1,String s2) {
		int num = 0;
		char a = 'y',a1 = 't',b = 's',b1 = 'd';
		for(int i = 0;i<s1.length();i++) {
			if(s1.charAt(i)!=s2.charAt(i)) {
				if(num==0) {
					a = s1.charAt(i);
					b = s2.charAt(i);
				}else {
					a1 = s1.charAt(i);
					b1 = s2.charAt(i);
				}
				num++;
				if(num>2)
					return false;
			}
		}
		if(a==b1&&b==a1)
			return true;
		return false;
	}
}
